<?php
// $Id$

include_once(APP_LIB_DIR . 'PollModel.class.php');
require_once(APP_LIB_DIR . 'LookupModel.class.php');
include_once(APP_LIB_DIR . 'paging.class.php');
include_once(APP_LIB_DIR . 'JSON.php');

class VoterListAction extends Action
{
    function getRequestMethods ()
    {
        return REQ_GET|REQ_POST;
    }

    function isSecure ()
    {
        return false;
    }

    function getPrivilege (&$controller, &$request, &$user)
    {
        return Array('');
    }

    function getDefaultView (&$controller, &$request, &$user)
    {
        return VIEW_INPUT;
    }

    function execute (&$controller, &$request, &$user)
    {
        $pm     = new PollModel('PollResultAction');
        $poll_id = $request->getParameter('poll_id');
        $poll_result_id = $request->getParameter('poll_result_id');
        //$poll_id = $request->getParameter('poll_id')
        $list = $pm->voter_list($poll_result_id);
        //$detail = $pm->detail($poll_id);
        
        $request->setAttribute('list', $list);
        return VIEW_INPUT;
    }

}

?>
